package com.ruoyi.business.service.impl;

import java.util.List;

import com.ruoyi.business.domain.BusContractCostDetail;
import com.ruoyi.business.domain.BusContractCostParam;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusContractCostMapper;
import com.ruoyi.business.domain.BusContractCost;
import com.ruoyi.business.service.IBusContractCostService;

/**
 * 合同成本Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-09-02
 */
@Service
public class BusContractCostServiceImpl implements IBusContractCostService 
{
    @Autowired
    private BusContractCostMapper busContractCostMapper;

    /**
     * 查询合同成本
     * 
     * @param costId 合同成本主键
     * @return 合同成本
     */
    @Override
    public BusContractCost selectBusContractCostByCostId(Long costId)
    {
        return busContractCostMapper.selectBusContractCostByCostId(costId);
    }

    /**
     * 查询合同成本列表
     * 
     * @param busContractCost 合同成本
     * @return 合同成本
     */
    @Override
    public List<BusContractCost> selectBusContractCostList(BusContractCost busContractCost)
    {
        return busContractCostMapper.selectBusContractCostList(busContractCost);
    }

    /**
     * 新增合同成本
     * 
     * @param busContractCost 合同成本
     * @return 结果
     */
    @Override
    public int insertBusContractCost(BusContractCost busContractCost)
    {
        busContractCost.setCreateTime(DateUtils.getNowDate());
        return busContractCostMapper.insertBusContractCost(busContractCost);
    }

    /**
     * 修改合同成本
     * 
     * @param busContractCost 合同成本
     * @return 结果
     */
    @Override
    public int updateBusContractCost(BusContractCost busContractCost)
    {
        busContractCost.setUpdateTime(DateUtils.getNowDate());
        return busContractCostMapper.updateBusContractCost(busContractCost);
    }

    /**
     * 批量删除合同成本
     * 
     * @param costIds 需要删除的合同成本主键
     * @return 结果
     */
    @Override
    public int deleteBusContractCostByCostIds(Long[] costIds)
    {
        return busContractCostMapper.deleteBusContractCostByCostIds(costIds);
    }

    /**
     * 删除合同成本信息
     * 
     * @param costId 合同成本主键
     * @return 结果
     */
    @Override
    public int deleteBusContractCostByCostId(Long costId)
    {
        return busContractCostMapper.deleteBusContractCostByCostId(costId);
    }

    /**
     * 获取合同成本列表信息
     * @return
     */
    @Override
    public List<BusContractCostDetail>  getContractCostList(BusContractCostParam busContractCostParam){
        return busContractCostMapper.getContractCostList(busContractCostParam);
    }
}
